package com.ruoyi.demo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.demo.mapper.AuctionCommentMapper;
import com.ruoyi.demo.domain.AuctionComment;
import com.ruoyi.demo.service.IAuctionCommentService;

/**
 * 商品评论Service业务层处理
 * 
 * @author metaee
 * @date 2025-05-06
 */
@Service
public class AuctionCommentServiceImpl implements IAuctionCommentService 
{
    @Autowired
    private AuctionCommentMapper auctionCommentMapper;

    /**
     * 查询商品评论
     * 
     * @param commentId 商品评论主键
     * @return 商品评论
     */
    @Override
    public AuctionComment selectAuctionCommentByCommentId(Long commentId)
    {
        return auctionCommentMapper.selectAuctionCommentByCommentId(commentId);
    }

    /**
     * 查询商品评论列表
     * 
     * @param auctionComment 商品评论
     * @return 商品评论
     */
    @Override
    public List<AuctionComment> selectAuctionCommentList(AuctionComment auctionComment)
    {
        return auctionCommentMapper.selectAuctionCommentList(auctionComment);
    }

    /**
     * 新增商品评论
     * 
     * @param auctionComment 商品评论
     * @return 结果
     */
    @Override
    public int insertAuctionComment(AuctionComment auctionComment)
    {
        auctionComment.setCreateTime(DateUtils.getNowDate());
        return auctionCommentMapper.insertAuctionComment(auctionComment);
    }

    /**
     * 修改商品评论
     * 
     * @param auctionComment 商品评论
     * @return 结果
     */
    @Override
    public int updateAuctionComment(AuctionComment auctionComment)
    {
        auctionComment.setUpdateTime(DateUtils.getNowDate());
        return auctionCommentMapper.updateAuctionComment(auctionComment);
    }

    /**
     * 批量删除商品评论
     * 
     * @param commentIds 需要删除的商品评论主键
     * @return 结果
     */
    @Override
    public int deleteAuctionCommentByCommentIds(Long[] commentIds)
    {
        return auctionCommentMapper.deleteAuctionCommentByCommentIds(commentIds);
    }

    /**
     * 删除商品评论信息
     * 
     * @param commentId 商品评论主键
     * @return 结果
     */
    @Override
    public int deleteAuctionCommentByCommentId(Long commentId)
    {
        return auctionCommentMapper.deleteAuctionCommentByCommentId(commentId);
    }
}
